//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS PI service.
///
/// Amazon RDS Performance Insights Amazon RDS Performance Insights enables you to monitor and explore different dimensions of database load based on data captured from a running DB instance. The guide provides detailed information about Performance Insights data types, parameters and errors. When Performance Insights is enabled, the Amazon RDS Performance Insights API provides visibility into the performance of your DB instance. Amazon CloudWatch provides the authoritative source for Amazon Web Services service-vended monitoring metrics. Performance Insights offers a domain-specific view of DB load. DB load is measured as average active sessions. Performance Insights provides the data to API consumers as a two-dimensional time-series dataset. The time dimension provides DB load data for each time point in the queried time range. Each time point decomposes overall load in relation to the requested dimensions, measured at that time point. Examples include SQL, Wait event, User, and Host.   To learn more about Performance Insights and Amazon Aurora DB instances, go to the  Amazon Aurora User Guide .    To learn more about Performance Insights and Amazon RDS DB instances, go to the  Amazon RDS User Guide .    To learn more about Performance Insights and Amazon DocumentDB clusters, go to the  Amazon DocumentDB Developer Guide .
public struct PI: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the PI client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "PerformanceInsightsv20180227",
            serviceName: "PI",
            serviceIdentifier: "pi",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2018-02-27",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: PIErrorType.self,
            xmlNamespace: "http://pi.amazonaws.com/doc/2018-02-27/",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.dualstack]: .init(endpoints: [
            "af-south-1": "pi.af-south-1.api.aws",
            "ap-east-1": "pi.ap-east-1.api.aws",
            "ap-northeast-1": "pi.ap-northeast-1.api.aws",
            "ap-northeast-2": "pi.ap-northeast-2.api.aws",
            "ap-northeast-3": "pi.ap-northeast-3.api.aws",
            "ap-south-1": "pi.ap-south-1.api.aws",
            "ap-south-2": "pi.ap-south-2.api.aws",
            "ap-southeast-1": "pi.ap-southeast-1.api.aws",
            "ap-southeast-2": "pi.ap-southeast-2.api.aws",
            "ap-southeast-3": "pi.ap-southeast-3.api.aws",
            "ap-southeast-4": "pi.ap-southeast-4.api.aws",
            "ap-southeast-5": "pi.ap-southeast-5.api.aws",
            "ap-southeast-7": "pi.ap-southeast-7.api.aws",
            "ca-central-1": "pi.ca-central-1.api.aws",
            "ca-west-1": "pi.ca-west-1.api.aws",
            "cn-north-1": "pi.cn-north-1.api.amazonwebservices.com.cn",
            "cn-northwest-1": "pi.cn-northwest-1.api.amazonwebservices.com.cn",
            "eu-central-1": "pi.eu-central-1.api.aws",
            "eu-central-2": "pi.eu-central-2.api.aws",
            "eu-north-1": "pi.eu-north-1.api.aws",
            "eu-south-1": "pi.eu-south-1.api.aws",
            "eu-south-2": "pi.eu-south-2.api.aws",
            "eu-west-1": "pi.eu-west-1.api.aws",
            "eu-west-2": "pi.eu-west-2.api.aws",
            "eu-west-3": "pi.eu-west-3.api.aws",
            "il-central-1": "pi.il-central-1.api.aws",
            "me-central-1": "pi.me-central-1.api.aws",
            "me-south-1": "pi.me-south-1.api.aws",
            "mx-central-1": "pi.mx-central-1.api.aws",
            "sa-east-1": "pi.sa-east-1.api.aws",
            "us-east-1": "pi.us-east-1.api.aws",
            "us-east-2": "pi.us-east-2.api.aws",
            "us-gov-east-1": "pi.us-gov-east-1.api.aws",
            "us-gov-west-1": "pi.us-gov-west-1.api.aws",
            "us-west-1": "pi.us-west-1.api.aws",
            "us-west-2": "pi.us-west-2.api.aws"
        ]),
        [.dualstack, .fips]: .init(endpoints: [
            "ca-central-1": "pi-fips.ca-central-1.api.aws",
            "ca-west-1": "pi-fips.ca-west-1.api.aws",
            "us-east-1": "pi-fips.us-east-1.api.aws",
            "us-east-2": "pi-fips.us-east-2.api.aws",
            "us-gov-east-1": "pi-fips.us-gov-east-1.api.aws",
            "us-gov-west-1": "pi-fips.us-gov-west-1.api.aws",
            "us-west-1": "pi-fips.us-west-1.api.aws",
            "us-west-2": "pi-fips.us-west-2.api.aws"
        ]),
        [.fips]: .init(endpoints: [
            "ca-central-1": "pi-fips.ca-central-1.amazonaws.com",
            "ca-west-1": "pi-fips.ca-west-1.amazonaws.com",
            "us-east-1": "pi-fips.us-east-1.amazonaws.com",
            "us-east-2": "pi-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "pi-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "pi-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "pi-fips.us-west-1.amazonaws.com",
            "us-west-2": "pi-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates a new performance analysis report for a specific time period for the DB instance.
    @Sendable
    @inlinable
    public func createPerformanceAnalysisReport(_ input: CreatePerformanceAnalysisReportRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePerformanceAnalysisReportResponse {
        try await self.client.execute(
            operation: "CreatePerformanceAnalysisReport", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new performance analysis report for a specific time period for the DB instance.
    ///
    /// Parameters:
    ///   - endTime: The end time defined for the analysis report.
    ///   - identifier: An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source. To use an Amazon RDS instance as a data source, you specify its DbiResourceId value.  For example, specify db-ADECBTYHKTSAUMUZQYPDS2GW4A.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS.
    ///   - startTime: The start time defined for the analysis report.
    ///   - tags: The metadata assigned to the analysis report consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func createPerformanceAnalysisReport(
        endTime: Date,
        identifier: String,
        serviceType: ServiceType,
        startTime: Date,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePerformanceAnalysisReportResponse {
        let input = CreatePerformanceAnalysisReportRequest(
            endTime: endTime, 
            identifier: identifier, 
            serviceType: serviceType, 
            startTime: startTime, 
            tags: tags
        )
        return try await self.createPerformanceAnalysisReport(input, logger: logger)
    }

    /// Deletes a performance analysis report.
    @Sendable
    @inlinable
    public func deletePerformanceAnalysisReport(_ input: DeletePerformanceAnalysisReportRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeletePerformanceAnalysisReportResponse {
        try await self.client.execute(
            operation: "DeletePerformanceAnalysisReport", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a performance analysis report.
    ///
    /// Parameters:
    ///   - analysisReportId: The unique identifier of the analysis report for deletion.
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source.  In the console, the identifier is shown as ResourceID. When you  call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePerformanceAnalysisReport(
        analysisReportId: String,
        identifier: String,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeletePerformanceAnalysisReportResponse {
        let input = DeletePerformanceAnalysisReportRequest(
            analysisReportId: analysisReportId, 
            identifier: identifier, 
            serviceType: serviceType
        )
        return try await self.deletePerformanceAnalysisReport(input, logger: logger)
    }

    /// For a specific time period, retrieve the top N dimension keys for a metric.   Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements,  only the first 500 bytes are returned.
    @Sendable
    @inlinable
    public func describeDimensionKeys(_ input: DescribeDimensionKeysRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeDimensionKeysResponse {
        try await self.client.execute(
            operation: "DescribeDimensionKeys", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For a specific time period, retrieve the top N dimension keys for a metric.   Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements,  only the first 500 bytes are returned.
    ///
    /// Parameters:
    ///   - additionalMetrics: Additional metrics for the top N dimension keys. If the specified dimension group in the GroupBy parameter is db.sql_tokenized, you can specify per-SQL metrics to get the values for the top N SQL digests. The response syntax is as follows: "AdditionalMetrics" : { "string" : "string" }. The only supported statistic function is .avg.
    ///   - endTime: The date and time specifying the end of the requested time series data. The value specified is exclusive, which means that data points less than (but not equal to) EndTime are returned. The value for EndTime must be later than the value for StartTime.
    ///   - filter: One or more filters to apply in the request. Restrictions:   Any number of filters by the same dimension, as specified in the GroupBy or Partition parameters.   A single filter for any other dimension in this dimension group.    The db.sql.db_id filter isn't available for RDS for SQL Server DB instances.
    ///   - groupBy: A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.
    ///   - identifier: An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source. To use an Amazon RDS instance as a data source, you specify its DbiResourceId value.  For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.
    ///   - metric: The name of a Performance Insights metric to be measured. Valid values for Metric are:    db.load.avg - A scaled representation of the number of active sessions for the database engine.     db.sampledload.avg - The raw number of active sessions for the database engine.    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg  and db.sampledload.avg are the same value. If the number of active sessions is greater than  the internal threshold, Performance Insights samples the active sessions, with db.load.avg  showing the scaled values, db.sampledload.avg showing the raw values, and  db.sampledload.avg less than db.load.avg. For most use cases, you can  query db.load.avg only.
    ///   - nextToken: An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.
    ///   - partitionBy: For each dimension specified in GroupBy, specify a secondary dimension  to further subdivide the partition keys in the response.
    ///   - periodInSeconds: The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as  one second, or as long as one day (86400 seconds). Valid values are:     1 (one second)    60 (one minute)    300 (five minutes)    3600 (one hour)    86400 (twenty-four hours)   If you don't specify PeriodInSeconds, then Performance Insights chooses a value for you, with a  goal of returning roughly 100-200 data points in the response.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:    RDS     DOCDB
    ///   - startTime: The date and time specifying the beginning of the requested time series data. You must specify a StartTime within the past 7 days. The value specified is inclusive,  which means that data points equal to or greater than StartTime are returned.  The value for StartTime must be earlier than the value for EndTime.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeDimensionKeys(
        additionalMetrics: [String]? = nil,
        endTime: Date,
        filter: [String: String]? = nil,
        groupBy: DimensionGroup,
        identifier: String,
        maxResults: Int? = nil,
        metric: String,
        nextToken: String? = nil,
        partitionBy: DimensionGroup? = nil,
        periodInSeconds: Int? = nil,
        serviceType: ServiceType,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeDimensionKeysResponse {
        let input = DescribeDimensionKeysRequest(
            additionalMetrics: additionalMetrics, 
            endTime: endTime, 
            filter: filter, 
            groupBy: groupBy, 
            identifier: identifier, 
            maxResults: maxResults, 
            metric: metric, 
            nextToken: nextToken, 
            partitionBy: partitionBy, 
            periodInSeconds: periodInSeconds, 
            serviceType: serviceType, 
            startTime: startTime
        )
        return try await self.describeDimensionKeys(input, logger: logger)
    }

    /// Get the attributes of the specified dimension group for a DB instance or data source. For example, if you specify a SQL ID, GetDimensionKeyDetails retrieves the full text of the dimension db.sql.statement associated with this ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys don't support retrieval of large SQL statement text, lock snapshots, and execution plans.
    @Sendable
    @inlinable
    public func getDimensionKeyDetails(_ input: GetDimensionKeyDetailsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDimensionKeyDetailsResponse {
        try await self.client.execute(
            operation: "GetDimensionKeyDetails", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get the attributes of the specified dimension group for a DB instance or data source. For example, if you specify a SQL ID, GetDimensionKeyDetails retrieves the full text of the dimension db.sql.statement associated with this ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys don't support retrieval of large SQL statement text, lock snapshots, and execution plans.
    ///
    /// Parameters:
    ///   - group: The name of the dimension group. Performance Insights searches the specified group for the dimension group ID. The following group name values are valid:    db.execution_plan (Amazon RDS and Aurora only)    db.lock_snapshot (Aurora only)    db.query (Amazon DocumentDB only)    db.sql (Amazon RDS and Aurora only)
    ///   - groupIdentifier: The ID of the dimension group from which to retrieve dimension details. For dimension group db.sql, the group ID is db.sql.id. The following group ID values are valid:    db.execution_plan.id for dimension group db.execution_plan (Aurora and RDS only)    db.sql.id for dimension group db.sql (Aurora and RDS only)    db.query.id for dimension group db.query (DocumentDB only)   For the dimension group db.lock_snapshot, the GroupIdentifier is the epoch timestamp when Performance Insights captured the snapshot, in seconds.  You can retrieve this value with the GetResourceMetrics operation for a 1 second period.
    ///   - identifier: The ID for a data source from which to gather dimension data. This ID must be immutable and  unique within an Amazon Web Services Region. When a DB instance is the data source, specify its  DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - requestedDimensions: A list of dimensions to retrieve the detail data for within the given dimension group. If you don't specify this parameter, Performance Insights returns all dimension data within the specified dimension group. Specify dimension names for the following dimension groups:    db.execution_plan - Specify the dimension name db.execution_plan.raw_plan or the short dimension name raw_plan (Amazon RDS and Aurora only)    db.lock_snapshot - Specify the dimension name db.lock_snapshot.lock_trees or the short dimension name lock_trees. (Aurora only)    db.sql - Specify either the full dimension name db.sql.statement or the short dimension name statement (Aurora and RDS only).    db.query - Specify either the full dimension name db.query.statement or the short dimension name statement (DocumentDB only).
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns data. The only valid value is RDS.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDimensionKeyDetails(
        group: String,
        groupIdentifier: String,
        identifier: String,
        requestedDimensions: [String]? = nil,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDimensionKeyDetailsResponse {
        let input = GetDimensionKeyDetailsRequest(
            group: group, 
            groupIdentifier: groupIdentifier, 
            identifier: identifier, 
            requestedDimensions: requestedDimensions, 
            serviceType: serviceType
        )
        return try await self.getDimensionKeyDetails(input, logger: logger)
    }

    /// Retrieves the report including the report ID, status, time details, and the insights with recommendations. The report status can be RUNNING, SUCCEEDED, or FAILED. The insights include the description and recommendation fields.
    @Sendable
    @inlinable
    public func getPerformanceAnalysisReport(_ input: GetPerformanceAnalysisReportRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPerformanceAnalysisReportResponse {
        try await self.client.execute(
            operation: "GetPerformanceAnalysisReport", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the report including the report ID, status, time details, and the insights with recommendations. The report status can be RUNNING, SUCCEEDED, or FAILED. The insights include the description and recommendation fields.
    ///
    /// Parameters:
    ///   - acceptLanguage: The text language in the report. The default language is EN_US (English).
    ///   - analysisReportId: A unique identifier of the created analysis report. For example, report-12345678901234567
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers  metrics from this data source. In the console, the identifier is shown as  ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights will return metrics. Valid value is RDS.
    ///   - textFormat: Indicates the text format in the report. The options are PLAIN_TEXT or MARKDOWN. The default value is plain text.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPerformanceAnalysisReport(
        acceptLanguage: AcceptLanguage? = nil,
        analysisReportId: String,
        identifier: String,
        serviceType: ServiceType,
        textFormat: TextFormat? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPerformanceAnalysisReportResponse {
        let input = GetPerformanceAnalysisReportRequest(
            acceptLanguage: acceptLanguage, 
            analysisReportId: analysisReportId, 
            identifier: identifier, 
            serviceType: serviceType, 
            textFormat: textFormat
        )
        return try await self.getPerformanceAnalysisReport(input, logger: logger)
    }

    /// Retrieve the metadata for different features. For example, the metadata might indicate  that a feature is turned on or off on a specific DB instance.
    @Sendable
    @inlinable
    public func getResourceMetadata(_ input: GetResourceMetadataRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetResourceMetadataResponse {
        try await self.client.execute(
            operation: "GetResourceMetadata", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieve the metadata for different features. For example, the metadata might indicate  that a feature is turned on or off on a specific DB instance.
    ///
    /// Parameters:
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region.  Performance Insights gathers metrics from this data source. To use a DB instance as a data source,  specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics.
    ///   - logger: Logger use during operation
    @inlinable
    public func getResourceMetadata(
        identifier: String,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetResourceMetadataResponse {
        let input = GetResourceMetadataRequest(
            identifier: identifier, 
            serviceType: serviceType
        )
        return try await self.getResourceMetadata(input, logger: logger)
    }

    /// Retrieve Performance Insights metrics for a set of data sources over a time period. You can provide specific dimension groups and dimensions, and provide filtering criteria for each group. You must specify an aggregate function for each metric.  Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements,  only the first 500 bytes are returned.
    @Sendable
    @inlinable
    public func getResourceMetrics(_ input: GetResourceMetricsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetResourceMetricsResponse {
        try await self.client.execute(
            operation: "GetResourceMetrics", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieve Performance Insights metrics for a set of data sources over a time period. You can provide specific dimension groups and dimensions, and provide filtering criteria for each group. You must specify an aggregate function for each metric.  Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements,  only the first 500 bytes are returned.
    ///
    /// Parameters:
    ///   - endTime: The date and time specifying the end of the requested time series query range. The value  specified is exclusive. Thus, the command returns data points less than  (but not equal to) EndTime. The value for EndTime must be later than the value for StartTime.
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - maxResults: The maximum number of items to return in the response.
    ///   - metricQueries: An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric db.load  you must use db.load.avg. Valid values for aggregate functions include .avg, .min,  .max, and .sum.
    ///   - nextToken: An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.
    ///   - periodAlignment: The returned timestamp which is the start or end time of the time periods. The default value is END_TIME.
    ///   - periodInSeconds: The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:    1 (one second)    60 (one minute)    300 (five minutes)    3600 (one hour)    86400 (twenty-four hours)   If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:    RDS     DOCDB
    ///   - startTime: The date and time specifying the beginning of the requested time series query range. You can't specify a StartTime that is earlier than 7 days ago. By default, Performance Insights has 7 days of  retention, but you can extend this range up to 2 years. The value specified is inclusive. Thus, the command returns data points equal to or greater  than StartTime. The value for StartTime must be earlier than the value for EndTime.
    ///   - logger: Logger use during operation
    @inlinable
    public func getResourceMetrics(
        endTime: Date,
        identifier: String,
        maxResults: Int? = nil,
        metricQueries: [MetricQuery],
        nextToken: String? = nil,
        periodAlignment: PeriodAlignment? = nil,
        periodInSeconds: Int? = nil,
        serviceType: ServiceType,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetResourceMetricsResponse {
        let input = GetResourceMetricsRequest(
            endTime: endTime, 
            identifier: identifier, 
            maxResults: maxResults, 
            metricQueries: metricQueries, 
            nextToken: nextToken, 
            periodAlignment: periodAlignment, 
            periodInSeconds: periodInSeconds, 
            serviceType: serviceType, 
            startTime: startTime
        )
        return try await self.getResourceMetrics(input, logger: logger)
    }

    /// Retrieve the dimensions that can be queried for each specified metric type on a specified DB instance.
    @Sendable
    @inlinable
    public func listAvailableResourceDimensions(_ input: ListAvailableResourceDimensionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAvailableResourceDimensionsResponse {
        try await self.client.execute(
            operation: "ListAvailableResourceDimensions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieve the dimensions that can be queried for each specified metric type on a specified DB instance.
    ///
    /// Parameters:
    ///   - authorizedActions: The actions to discover the dimensions you are authorized to access. If you specify multiple actions, then the response will contain the dimensions common for all the actions. When you don't specify this request parameter or provide an empty list, the response contains all the  available dimensions for the target database engine whether or not you are authorized to access them.
    ///   - identifier: An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VWZ.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified  MaxRecords value, a pagination token is included in the response so that the remaining  results can be retrieved.
    ///   - metrics: The types of metrics for which to retrieve dimensions. Valid values include db.load.
    ///   - nextToken: An optional pagination token provided by a previous request. If this parameter is specified,  the response includes only records beyond the token, up to the value specified by MaxRecords.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAvailableResourceDimensions(
        authorizedActions: [FineGrainedAction]? = nil,
        identifier: String,
        maxResults: Int? = nil,
        metrics: [String],
        nextToken: String? = nil,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAvailableResourceDimensionsResponse {
        let input = ListAvailableResourceDimensionsRequest(
            authorizedActions: authorizedActions, 
            identifier: identifier, 
            maxResults: maxResults, 
            metrics: metrics, 
            nextToken: nextToken, 
            serviceType: serviceType
        )
        return try await self.listAvailableResourceDimensions(input, logger: logger)
    }

    /// Retrieve metrics of the specified types that can be queried for a specified DB instance.
    @Sendable
    @inlinable
    public func listAvailableResourceMetrics(_ input: ListAvailableResourceMetricsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAvailableResourceMetricsResponse {
        try await self.client.execute(
            operation: "ListAvailableResourceMetrics", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieve metrics of the specified types that can be queried for a specified DB instance.
    ///
    /// Parameters:
    ///   - identifier: An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VWZ.
    ///   - maxResults: The maximum number of items to return. If the MaxRecords value is less than the number  of existing items, the response includes a pagination token.
    ///   - metricTypes: The types of metrics to return in the response. Valid values in the array include the following:    os (OS counter metrics) - All engines    db (DB load metrics) - All engines except for Amazon DocumentDB    db.sql.stats (per-SQL metrics) - All engines except for Amazon DocumentDB    db.sql_tokenized.stats (per-SQL digest metrics) - All engines except for Amazon DocumentDB
    ///   - nextToken: An optional pagination token provided by a previous request. If this parameter is specified,  the response includes only records beyond the token, up to the value specified by MaxRecords.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAvailableResourceMetrics(
        identifier: String,
        maxResults: Int? = nil,
        metricTypes: [String],
        nextToken: String? = nil,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAvailableResourceMetricsResponse {
        let input = ListAvailableResourceMetricsRequest(
            identifier: identifier, 
            maxResults: maxResults, 
            metricTypes: metricTypes, 
            nextToken: nextToken, 
            serviceType: serviceType
        )
        return try await self.listAvailableResourceMetrics(input, logger: logger)
    }

    /// Lists all the analysis reports created for the DB instance. The reports are sorted based on the start time of each report.
    @Sendable
    @inlinable
    public func listPerformanceAnalysisReports(_ input: ListPerformanceAnalysisReportsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPerformanceAnalysisReportsResponse {
        try await self.client.execute(
            operation: "ListPerformanceAnalysisReports", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all the analysis reports created for the DB instance. The reports are sorted based on the start time of each report.
    ///
    /// Parameters:
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - listTags: Specifies whether or not to include the list of tags in the response.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified MaxResults value, a pagination token is included in the response so that the remaining results can be retrieved.
    ///   - nextToken: An optional pagination token provided by a previous request.  If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxResults.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPerformanceAnalysisReports(
        identifier: String,
        listTags: Bool? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPerformanceAnalysisReportsResponse {
        let input = ListPerformanceAnalysisReportsRequest(
            identifier: identifier, 
            listTags: listTags, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            serviceType: serviceType
        )
        return try await self.listPerformanceAnalysisReports(input, logger: logger)
    }

    /// Retrieves all the metadata tags associated with Amazon RDS Performance Insights resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all the metadata tags associated with Amazon RDS Performance Insights resource.
    ///
    /// Parameters:
    ///   - resourceARN: Lists all the tags for the Amazon RDS Performance Insights resource. This value is an  Amazon Resource Name (ARN). For information about creating an ARN,  see  Constructing an RDS Amazon Resource Name (ARN).
    ///   - serviceType: List the tags for the Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceARN: String,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceARN: resourceARN, 
            serviceType: serviceType
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Adds metadata tags to the Amazon RDS Performance Insights resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds metadata tags to the Amazon RDS Performance Insights resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about   creating an ARN, see  Constructing an RDS Amazon Resource Name (ARN).
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.
    ///   - tags: The metadata assigned to an Amazon RDS resource consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        serviceType: ServiceType,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceARN: resourceARN, 
            serviceType: serviceType, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Deletes the metadata tags from the Amazon RDS Performance Insights resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the metadata tags from the Amazon RDS Performance Insights resource.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about   creating an ARN, see  Constructing an RDS Amazon Resource Name (ARN).
    ///   - serviceType: List the tags for the Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.
    ///   - tagKeys: The metadata assigned to an Amazon RDS Performance Insights resource consisting of a key-value pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        serviceType: ServiceType,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceARN: resourceARN, 
            serviceType: serviceType, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }
}

extension PI {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: PI, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension PI {
    /// Return PaginatorSequence for operation ``describeDimensionKeys(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeDimensionKeysPaginator(
        _ input: DescribeDimensionKeysRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeDimensionKeysRequest, DescribeDimensionKeysResponse> {
        return .init(
            input: input,
            command: self.describeDimensionKeys,
            inputKey: \DescribeDimensionKeysRequest.nextToken,
            outputKey: \DescribeDimensionKeysResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeDimensionKeys(_:logger:)``.
    ///
    /// - Parameters:
    ///   - additionalMetrics: Additional metrics for the top N dimension keys. If the specified dimension group in the GroupBy parameter is db.sql_tokenized, you can specify per-SQL metrics to get the values for the top N SQL digests. The response syntax is as follows: "AdditionalMetrics" : { "string" : "string" }. The only supported statistic function is .avg.
    ///   - endTime: The date and time specifying the end of the requested time series data. The value specified is exclusive, which means that data points less than (but not equal to) EndTime are returned. The value for EndTime must be later than the value for StartTime.
    ///   - filter: One or more filters to apply in the request. Restrictions:   Any number of filters by the same dimension, as specified in the GroupBy or Partition parameters.   A single filter for any other dimension in this dimension group.    The db.sql.db_id filter isn't available for RDS for SQL Server DB instances.
    ///   - groupBy: A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.
    ///   - identifier: An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source. To use an Amazon RDS instance as a data source, you specify its DbiResourceId value.  For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.
    ///   - metric: The name of a Performance Insights metric to be measured. Valid values for Metric are:    db.load.avg - A scaled representation of the number of active sessions for the database engine.     db.sampledload.avg - The raw number of active sessions for the database engine.    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg  and db.sampledload.avg are the same value. If the number of active sessions is greater than  the internal threshold, Performance Insights samples the active sessions, with db.load.avg  showing the scaled values, db.sampledload.avg showing the raw values, and  db.sampledload.avg less than db.load.avg. For most use cases, you can  query db.load.avg only.
    ///   - partitionBy: For each dimension specified in GroupBy, specify a secondary dimension  to further subdivide the partition keys in the response.
    ///   - periodInSeconds: The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as  one second, or as long as one day (86400 seconds). Valid values are:     1 (one second)    60 (one minute)    300 (five minutes)    3600 (one hour)    86400 (twenty-four hours)   If you don't specify PeriodInSeconds, then Performance Insights chooses a value for you, with a  goal of returning roughly 100-200 data points in the response.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:    RDS     DOCDB
    ///   - startTime: The date and time specifying the beginning of the requested time series data. You must specify a StartTime within the past 7 days. The value specified is inclusive,  which means that data points equal to or greater than StartTime are returned.  The value for StartTime must be earlier than the value for EndTime.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeDimensionKeysPaginator(
        additionalMetrics: [String]? = nil,
        endTime: Date,
        filter: [String: String]? = nil,
        groupBy: DimensionGroup,
        identifier: String,
        maxResults: Int? = nil,
        metric: String,
        partitionBy: DimensionGroup? = nil,
        periodInSeconds: Int? = nil,
        serviceType: ServiceType,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeDimensionKeysRequest, DescribeDimensionKeysResponse> {
        let input = DescribeDimensionKeysRequest(
            additionalMetrics: additionalMetrics, 
            endTime: endTime, 
            filter: filter, 
            groupBy: groupBy, 
            identifier: identifier, 
            maxResults: maxResults, 
            metric: metric, 
            partitionBy: partitionBy, 
            periodInSeconds: periodInSeconds, 
            serviceType: serviceType, 
            startTime: startTime
        )
        return self.describeDimensionKeysPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getResourceMetrics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getResourceMetricsPaginator(
        _ input: GetResourceMetricsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetResourceMetricsRequest, GetResourceMetricsResponse> {
        return .init(
            input: input,
            command: self.getResourceMetrics,
            inputKey: \GetResourceMetricsRequest.nextToken,
            outputKey: \GetResourceMetricsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getResourceMetrics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - endTime: The date and time specifying the end of the requested time series query range. The value  specified is exclusive. Thus, the command returns data points less than  (but not equal to) EndTime. The value for EndTime must be later than the value for StartTime.
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - maxResults: The maximum number of items to return in the response.
    ///   - metricQueries: An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric db.load  you must use db.load.avg. Valid values for aggregate functions include .avg, .min,  .max, and .sum.
    ///   - periodAlignment: The returned timestamp which is the start or end time of the time periods. The default value is END_TIME.
    ///   - periodInSeconds: The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:    1 (one second)    60 (one minute)    300 (five minutes)    3600 (one hour)    86400 (twenty-four hours)   If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:    RDS     DOCDB
    ///   - startTime: The date and time specifying the beginning of the requested time series query range. You can't specify a StartTime that is earlier than 7 days ago. By default, Performance Insights has 7 days of  retention, but you can extend this range up to 2 years. The value specified is inclusive. Thus, the command returns data points equal to or greater  than StartTime. The value for StartTime must be earlier than the value for EndTime.
    ///   - logger: Logger used for logging
    @inlinable
    public func getResourceMetricsPaginator(
        endTime: Date,
        identifier: String,
        maxResults: Int? = nil,
        metricQueries: [MetricQuery],
        periodAlignment: PeriodAlignment? = nil,
        periodInSeconds: Int? = nil,
        serviceType: ServiceType,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetResourceMetricsRequest, GetResourceMetricsResponse> {
        let input = GetResourceMetricsRequest(
            endTime: endTime, 
            identifier: identifier, 
            maxResults: maxResults, 
            metricQueries: metricQueries, 
            periodAlignment: periodAlignment, 
            periodInSeconds: periodInSeconds, 
            serviceType: serviceType, 
            startTime: startTime
        )
        return self.getResourceMetricsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAvailableResourceDimensions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAvailableResourceDimensionsPaginator(
        _ input: ListAvailableResourceDimensionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAvailableResourceDimensionsRequest, ListAvailableResourceDimensionsResponse> {
        return .init(
            input: input,
            command: self.listAvailableResourceDimensions,
            inputKey: \ListAvailableResourceDimensionsRequest.nextToken,
            outputKey: \ListAvailableResourceDimensionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAvailableResourceDimensions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - authorizedActions: The actions to discover the dimensions you are authorized to access. If you specify multiple actions, then the response will contain the dimensions common for all the actions. When you don't specify this request parameter or provide an empty list, the response contains all the  available dimensions for the target database engine whether or not you are authorized to access them.
    ///   - identifier: An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VWZ.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified  MaxRecords value, a pagination token is included in the response so that the remaining  results can be retrieved.
    ///   - metrics: The types of metrics for which to retrieve dimensions. Valid values include db.load.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAvailableResourceDimensionsPaginator(
        authorizedActions: [FineGrainedAction]? = nil,
        identifier: String,
        maxResults: Int? = nil,
        metrics: [String],
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAvailableResourceDimensionsRequest, ListAvailableResourceDimensionsResponse> {
        let input = ListAvailableResourceDimensionsRequest(
            authorizedActions: authorizedActions, 
            identifier: identifier, 
            maxResults: maxResults, 
            metrics: metrics, 
            serviceType: serviceType
        )
        return self.listAvailableResourceDimensionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAvailableResourceMetrics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAvailableResourceMetricsPaginator(
        _ input: ListAvailableResourceMetricsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAvailableResourceMetricsRequest, ListAvailableResourceMetricsResponse> {
        return .init(
            input: input,
            command: self.listAvailableResourceMetrics,
            inputKey: \ListAvailableResourceMetricsRequest.nextToken,
            outputKey: \ListAvailableResourceMetricsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAvailableResourceMetrics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - identifier: An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VWZ.
    ///   - maxResults: The maximum number of items to return. If the MaxRecords value is less than the number  of existing items, the response includes a pagination token.
    ///   - metricTypes: The types of metrics to return in the response. Valid values in the array include the following:    os (OS counter metrics) - All engines    db (DB load metrics) - All engines except for Amazon DocumentDB    db.sql.stats (per-SQL metrics) - All engines except for Amazon DocumentDB    db.sql_tokenized.stats (per-SQL digest metrics) - All engines except for Amazon DocumentDB
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAvailableResourceMetricsPaginator(
        identifier: String,
        maxResults: Int? = nil,
        metricTypes: [String],
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAvailableResourceMetricsRequest, ListAvailableResourceMetricsResponse> {
        let input = ListAvailableResourceMetricsRequest(
            identifier: identifier, 
            maxResults: maxResults, 
            metricTypes: metricTypes, 
            serviceType: serviceType
        )
        return self.listAvailableResourceMetricsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPerformanceAnalysisReports(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPerformanceAnalysisReportsPaginator(
        _ input: ListPerformanceAnalysisReportsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPerformanceAnalysisReportsRequest, ListPerformanceAnalysisReportsResponse> {
        return .init(
            input: input,
            command: self.listPerformanceAnalysisReports,
            inputKey: \ListPerformanceAnalysisReportsRequest.nextToken,
            outputKey: \ListPerformanceAnalysisReportsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPerformanceAnalysisReports(_:logger:)``.
    ///
    /// - Parameters:
    ///   - identifier: An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId. To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
    ///   - listTags: Specifies whether or not to include the list of tags in the response.
    ///   - maxResults: The maximum number of items to return in the response. If more items exist than the specified MaxResults value, a pagination token is included in the response so that the remaining results can be retrieved.
    ///   - serviceType: The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPerformanceAnalysisReportsPaginator(
        identifier: String,
        listTags: Bool? = nil,
        maxResults: Int? = nil,
        serviceType: ServiceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPerformanceAnalysisReportsRequest, ListPerformanceAnalysisReportsResponse> {
        let input = ListPerformanceAnalysisReportsRequest(
            identifier: identifier, 
            listTags: listTags, 
            maxResults: maxResults, 
            serviceType: serviceType
        )
        return self.listPerformanceAnalysisReportsPaginator(input, logger: logger)
    }
}

extension PI.DescribeDimensionKeysRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PI.DescribeDimensionKeysRequest {
        return .init(
            additionalMetrics: self.additionalMetrics,
            endTime: self.endTime,
            filter: self.filter,
            groupBy: self.groupBy,
            identifier: self.identifier,
            maxResults: self.maxResults,
            metric: self.metric,
            nextToken: token,
            partitionBy: self.partitionBy,
            periodInSeconds: self.periodInSeconds,
            serviceType: self.serviceType,
            startTime: self.startTime
        )
    }
}

extension PI.GetResourceMetricsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PI.GetResourceMetricsRequest {
        return .init(
            endTime: self.endTime,
            identifier: self.identifier,
            maxResults: self.maxResults,
            metricQueries: self.metricQueries,
            nextToken: token,
            periodAlignment: self.periodAlignment,
            periodInSeconds: self.periodInSeconds,
            serviceType: self.serviceType,
            startTime: self.startTime
        )
    }
}

extension PI.ListAvailableResourceDimensionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PI.ListAvailableResourceDimensionsRequest {
        return .init(
            authorizedActions: self.authorizedActions,
            identifier: self.identifier,
            maxResults: self.maxResults,
            metrics: self.metrics,
            nextToken: token,
            serviceType: self.serviceType
        )
    }
}

extension PI.ListAvailableResourceMetricsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PI.ListAvailableResourceMetricsRequest {
        return .init(
            identifier: self.identifier,
            maxResults: self.maxResults,
            metricTypes: self.metricTypes,
            nextToken: token,
            serviceType: self.serviceType
        )
    }
}

extension PI.ListPerformanceAnalysisReportsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> PI.ListPerformanceAnalysisReportsRequest {
        return .init(
            identifier: self.identifier,
            listTags: self.listTags,
            maxResults: self.maxResults,
            nextToken: token,
            serviceType: self.serviceType
        )
    }
}
